package oop.core.view;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;

import oop.core.entity.Occupation;
import oop.core.skill.ActiveSkill;
import oop.core.skill.Cone;
import oop.core.skill.InteractiveSkill;
import oop.core.skill.PickPocket;
import oop.core.skill.Radial;
import oop.core.skill.Skill;

/**
 * 
 * This represents the Skill area of the game
 *
 */
public class SkillsPanel extends SizeablePanel {

	private static final Dimension SIZE = new Dimension(400, 270);
	private static final Point LOCATION = new Point(600, 130);
	
	private Occupation occupation;
	
	public SkillsPanel()
	{
		super(LOCATION, SIZE);
	}
	
	public void takeOccupation(Occupation occupation)
	{
		this.occupation = occupation;
	}
	
	protected void paintComponent(Graphics g)
	{
//		System.out.println("Painting SkillsPanel");
		g.setColor(Color.RED);
		g.fillRect(0, 0, SIZE.width, SIZE.height);

		List<ActiveSkill> activeSkills = occupation.getActiveSkill();
		
		if(activeSkills != null)
		for(int k=0; k<activeSkills.size(); k++)
		{
			ActiveSkill skill = activeSkills.get(k);
			if(skill == null)
				continue;
			if(skill.getSkillLevel() == 0)
				g.setColor(Color.WHITE);
			else
				g.setColor(Color.BLACK);
			g.drawString(skill.getName() + " : " + skill.getSkillLevel(), 50, 100+k*15);
		}
		
		
	}
}
